import App from './App'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
import '@/static/index.css'
const app = new Vue({
	...App
})
import uView from "uview-ui";
Vue.use(uView);
Vue.prototype.$img = (item) => 'url(' + item + ')'
import {
	to,
	list
} from '@/untils/index.js'
import * as filters from '@/untils/filters'
Object.keys(filters).forEach((key) => {
	Vue.filter(key, filters[key])
})
Vue.prototype.$to = to

Vue.prototype.$http = 'https://puputong.huijipin.cn/'
Vue.prototype.$list = list
Vue.prototype.$tel =(item) => {
	let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
	return reg_tel.test(item)
}
Vue.prototype.$toast = (item, a) => {
	uni.showToast({
		title: item,
		icon: "none",
	});
}
import {
	api
} from '@/untils/request.js'
import {
	wx_login
} from '@/untils/login.js'
Vue.prototype.api = api
Vue.prototype.$pimage = (a) => {
	let imgs = []
	imgs.push(a)
	console.log(imgs);
	uni.previewImage({
		urls: imgs,
		current:0
	})
}
Vue.prototype.$wx_login = wx_login
//引入vuex
import store from './store'
//把vuex定义成全局组件
Vue.prototype.$store = store
Vue.prototype.$height = () => {
	return uni.getSystemInfoSync().screenHeight
}
Vue.prototype.$width = () => {
	return uni.getSystemInfoSync().screenWidth
}
Vue.prototype.$top = () => {
	return uni.getSystemInfoSync().statusBarHeight
}
app.$mount()
// #endif
// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
